package com.itany.nmms.service;

import com.github.pagehelper.PageInfo;
import com.itany.nmms.entity.Product;
import com.itany.nmms.exception.FileUploadErrorException;
import com.itany.nmms.exception.ProductExistException;
import com.itany.nmms.exception.RequestParameterErrorException;
import com.itany.nmms.exception.ServiceException;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 石小俊
 * @date 2024年04月24日 18:09
 */
public interface ProductService {

    /**
     * 添加商品信息
     * @param name
     * @param price
     * @param description
     * @param file
     * @param typeId
     * @throws RequestParameterErrorException
     * @throws ProductExistException
     * @throws FileUploadErrorException
     * @throws ServiceException
     */
    void addProduct(String name, String price, String description, MultipartFile file, String typeId) throws RequestParameterErrorException, ProductExistException, FileUploadErrorException, ServiceException;

    /**
     * 分页查询商品信息
     * @param pageNo
     * @param pageSize
     * @return
     */
    PageInfo<Product> findPage(String pageNo, String pageSize) throws ServiceException;

    Product findById(String id) throws RequestParameterErrorException, ServiceException;

    void modifyProduct(String id, String name, String price, String description, MultipartFile file, String typeId) throws RequestParameterErrorException, ProductExistException, FileUploadErrorException, ServiceException;

    void removeById(String id) throws RequestParameterErrorException, ServiceException;

}
